﻿//using Castle.Core.Resource;
//using Microsoft.EntityFrameworkCore;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;

//namespace PLCS.EntityFrameworkCore
//{
//    public class PLCSEfCoreBulkOperationProvider : IEfCoreBulkOperationProvider
//    {
//        async Task IEfCoreBulkOperationProvider.DeleteManyAsync<TDbContext, TEntity>(IEfCoreRepository<TEntity> repository, IEnumerable<TEntity> entities, bool autoSave, CancellationToken cancellationToken)
//        {
//            var dbContext = await repository.GetDbContextAsync();
//            await dbContext.BulkUpdateAsync(entities, cancellationToken);
//        }

//        async Task IEfCoreBulkOperationProvider.InsertManyAsync<TDbContext, TEntity>(IEfCoreRepository<TEntity> repository, IEnumerable<TEntity> entities, bool autoSave, CancellationToken cancellationToken)
//        {
//            var dbContext = await repository.GetDbContextAsync();
//            await dbContext.BulkInsertAsync(entities, cancellationToken);
//        }

//        async Task IEfCoreBulkOperationProvider.UpdateManyAsync<TDbContext, TEntity>(IEfCoreRepository<TEntity> repository, IEnumerable<TEntity> entities, bool autoSave, CancellationToken cancellationToken)
//        {
//            var dbContext = await repository.GetDbContextAsync();
//            await dbContext.BulkDeleteAsync(entities, cancellationToken);
//        }
//    }
//}